using UnityEngine;
using System;

public class GUITextureNode : GUINode
{
    public int TextureSize = 128;
    public Texture2D Texture;

    public virtual void Awake()
    {
        Width = TextureSize;
        Height = TextureSize;

        if (Texture==null)
            Texture = CreateTexture();
    }

    public override void DrawGUI()
    {
        GUI.DrawTexture(new Rect(PositionX, PositionY, Width, Height), Texture, ScaleMode.ScaleAndCrop, false);
        GUI.Label(new Rect(PositionX, PositionY+Height, Width, 50.0f), name);
    }

    protected virtual Texture2D CreateTexture()
    {
        throw new NotImplementedException();
    }
}